<script type="text/javascript">
    firstLevel = "<?php echo Router::url('/'); ?>";
</script>
<?php

?>
<?php //echo $this->Html->script(array('https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js')); ?>
<?php echo $this->Html->script('report/index'); ?>
<?php echo $this->Html->css('report/report_manager'); ?>
<div id="content">
	<!--  start page-heading -->
	<div id="page-heading">
		<h1>Report Manager</h1>
    <?php //echo $this->Html->link("Ticket", array('action' => 'add')); ?>&nbsp;&nbsp;
	</div>
	<!-- end page-heading -->
	<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
	<tr>
		<th rowspan="3" class="sized">
        <?php echo $this->Html->image('/images/shared/side_shadowleft.jpg', array('width' => '20', 'height' => '300', 'alt' => '')); ?>
    </th>
		<th class="topleft"></th>
		<td id="tbl-border-top">&nbsp;</td>
		<th class="topright"></th>
		<th rowspan="3" class="sized">
        <?php echo $this->Html->image('/images/shared/side_shadowright.jpg', array('width' => '20', 'height' => '300', 'alt' => '')); ?>
    </th>
	</tr>
	<tr>
		<td id="tbl-border-left"></td>
		<td valign="top">
		<!--  start content-table-inner ...................................................................... START -->
		
			<!--  start table-content  -->

		  <div id="content-table-inner">
                <?php echo $this->Session->flash(); ?>
        <div class="reportManager index">
                <div id="repoManLeftCol">
                  <?php echo $this->Form->create('ReportManager'); ?>
                  <fieldset>
                  <legend><?php echo __('New report'); ?></legend>        
                  <?php 
                      echo $this->Form->input('model', array(
                                                      'type' => 'select', 
                                                      'label'=>__('Model'), 
                                                      'options'=>$models, 
                                                      'empty'=>__('--Select--'),
                                                      'class' => 'chosen'
                                                    )
                                                ); 
                  ?>
                  <?php 
                      echo $this->Form->input('one_to_many_option',array(
                                                      'type'=>'select',
                                                      'label'=>__('One to many option'),
                                                      'options'=>array(),
                                                      'empty'=>__('<None>'),
                                                      'div' => array("id" => "ReportManagerOneToManyOptionSelect"),
                                                      'class' => 'chosen'
                                                    )
                                                );
                  ?>
                  
                  </fieldset>
                  <?php echo $this->Form->submit(__('New Report'),array('name'=>'new', 'class' => 'submit-button')); ?>
                  <?php echo $this->Form->end(); ?>
                </div>
                
                <div id="repoManMiddleCol">
                    <?php echo $this->Html->tag('h2','OR'); ?>
                </div>
                
                <div id="repoManRightCol">
                  <?php echo $this->Form->create('ReportManager', array("target"=>"_blank")); ?>
                  <fieldset>
                  <legend><?php echo __('Load report'); ?></legend>        
                          <?php echo $this->Form->input('saved_report_option',array(
                                                              'type' => 'select',
                                                              'label' => __('Saved Reports'),
                                                              'options' => $files,
                                                              'empty' => __('--Select--'),
                                                              'div' => array('id' => 'ReportManagerSavedReportOptionContainer'),
                                                              'class' => 'chosen'
                                                            )
                                                        );
                          ?>    
                          <?php $predefined = array("cus" => "Customer Report"); ?>                          
                          <?php echo $this->Form->input('predefined_reports',array(
                                                              'type' => 'select',
                                                              'label' => __('Predefined Reports'),
                                                              'options' => $predefined,
                                                              'empty' => __('--Select--'),
                                                              'div' => array('id' => 'ReportManagerSavedReportOptionContainer'),
                                                              'class' => 'chosen'
                                                            )
                                                        );
                          ?>                              
                
                   </fieldset>
                   <div class="submit">
                        <button type="button" class="deleteReport cancel-button">Delete</button>
                        <?php echo $this->Form->submit(__('Load Report'),array('name'=>'load', 'div' => false, 'class' => 'submit-button')); ?>
                        <?php echo $this->Form->end(); ?>
                   </div> 
                </div>
        </div>

  		</div>
      <!--  end content-table  -->
		<!--  end content-table-inner ............................................END  -->
		</td>
		<td id="tbl-border-right"></td>
	</tr>
	<tr>
		<th class="sized bottomleft"></th>
		<td id="tbl-border-bottom">&nbsp;</td>
		<th class="sized bottomright"></th>
	</tr>
	</table>
	<div class="clear">&nbsp;</div>

</div>
<script type="text/javascript">
 $(document).ready(function() {
    $("#reportsMenu").addClass("current");
 });
</script>